from django.urls import path, include
from rest_framework.routers import DefaultRouter
from . import views

# 创建路由器
router = DefaultRouter()

# 注册视图集
router.register(r'metrics', views.SystemMetricViewSet, basename='systemmetric')
router.register(r'metric-data', views.MetricDataViewSet, basename='metricdata')
router.register(r'alerts', views.SystemAlertViewSet, basename='systemalert')
router.register(r'health-checks', views.HealthCheckViewSet, basename='healthcheck')
router.register(r'performance-logs', views.PerformanceLogViewSet, basename='performancelog')
router.register(r'configurations', views.SystemConfigurationViewSet, basename='systemconfiguration')
router.register(r'dashboards', views.MonitoringDashboardViewSet, basename='monitoringdashboard')
router.register(r'overview', views.MonitoringOverviewView, basename='monitoringoverview')

# URL模式
urlpatterns = [
    # API路由
    path('api/', include(router.urls)),
    
    # 自定义路径（如果需要）
    # path('api/custom-endpoint/', views.CustomView.as_view(), name='custom-endpoint'),
]

# 应用名称
app_name = 'system_monitoring'